package jhavelogger.models;

import java.util.Date;

import jhavelogger.visitor.LogVisitor;

/**
 * Specifies that a user has looked up a particular algorithm.
 * 
 * @author Jared Schlicht
 */
public class UsernameLookup extends JHaveLog {
    private String username;

    public UsernameLookup(String logSource, String username) {
	this.setLogSource(logSource);
	this.setUsername(username);
    }

    /**
     * Sets the username
     * @param username the username to set
     */
    public void setUsername(String username) {
	this.username = username;
    }

    /**
     * Gets the username
     * @return the username
     */
    public String getUsername() {
	return username;
    }
    
    @Override
    public Object accept(LogVisitor visitor) {
	return visitor.visit(this);
    }
    
    @Override
    public String toString() {
	return "Algorithm Lookup on " + this.getLogSource() + ". Username: " + this.getUsername();
    }
}
